Skip to content

Conversation

@tisonkun
Copy link
Member

@tisonkun tisonkun commented Feb 8, 2026

This follows #84 (comment).

I have two questions:

  1. Shall we check the seed when creating sketches? Currently, we check only when serde, thus if the sketch never serde, we don't have this guard. Not sure if check earilier helps.
  2. Since the serialized seed_hash occurs in the middle of the final result, I'm curious about the format of earlier serialized sketches. Do they have a placeholder 2-byte buffer that is fulfilled in later version? If we panic always when the computed seed = 0, then all those old snapshots cannot be read.

cc @ZENOTME @leerho

Signed-off-by: tison <wander4096@gmail.com>
@ZENOTME
Copy link
Contributor

ZENOTME commented Feb 8, 2026

  1. Shall we check the seed when creating sketches? Currently, we check only when serde, thus if the sketch never serde, we don't have this guard. Not sure if check earilier helps.

I think we should check the seed when creating sketches. I think it's not convenient to change the seek after using the sketch, so it's better to guarantee that the seed hash is valid at begining.

@leerho
Copy link
Member

leerho commented Feb 9, 2026

U r right! Checking the seed when first entered makes the most sense.

@tisonkun
Copy link
Member Author

Updated.

@leerho I'd appreciate it if you can share some history about:

Since the serialized seed_hash occurs in the middle of the final result, I'm curious about the format of earlier serialized sketches. Do they have a placeholder 2-byte buffer that is fulfilled in later version? If we panic always when the computed seed = 0, then all those old snapshots cannot be read.

What does an old serialized sketch without seed concept look like?

@tisonkun tisonkun enabled auto-merge (squash) February 11, 2026 01:26
@tisonkun tisonkun merged commit 9a83070 into main Feb 11, 2026
9 checks passed
@tisonkun tisonkun deleted the check-seed branch February 11, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants